<?php
  require_once('system/dbconn.php');
  require_once('system/myfun.php');
  connect();
if (($_FILES["GL_jiajulink"]["type"] == "image/jpeg")
&& ($_FILES["GL_jiajulink"]["size"] < 1024*1024))
  {
  if ($_FILES["GL_jiajulink"]["error"] > 0)
    {
    echo "Error: " . $_FILES["GL_jiajulink"]["error"] . "<br />";
    }
  else
    {
    echo "Upload: " . $_FILES["GL_jiajulink"]["name"] . "<br />";
    echo "Type: " . $_FILES["GL_jiajulink"]["type"] . "<br />";
    echo "Size: " . ($_FILES["GL_jiajulink"]["size"] ) . " Kb<br />";
    echo "Stored in: " . $_FILES["GL_jiajulink"]["tmp_name"];
    }
  }
else
  {
  echo "Invalid file";
  }
  $data = array(
    'GL_jiajulink' => $_POST['GL_jiajulink'],
    'GL_name' =>$_POST['GL_name'],  
    'GL_brand' => $_POST['GL_brand'],
    'GL_cname' => $_POST['GL_cname'],
    'GL_adddate' => $_POST['GL_adddate'],
    );
  $result = add('jiaju',$data); 
  if(!$result)
  {
    echo "添加失败！<br/>";
    echo "<a href='addjiaju.php'>返回</a>";    
  }
  else
  {   
   redirect('list.php','添加成功！'); 
  }    
?>
  




